﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace chesslibrary.cs
{
    public class properties_cell :cell_chess
    {
        private pieces_chess piece;
		internal properties_cell(int row,int col):base(row,col){}
       // internal properties_cell(string s):base(s){}		
		internal void setPiece(pieces_chess piece)
		{
			this.piece=piece;
		}
		public pieces_chess pieces_chess
		{
			get{return piece;}
		}
		public bool IsOwnedBy(color_pieces side)
		{
			if (IsEmpty())
			{
				return false;
			}	
			return piece.Owner==side;	
		}
		public bool IsEnemyOf(color_pieces side)
		{
			if (IsEmpty())
			{
				return false;
			}	
			return (piece.Owner!=side);	
		}
	    public bool IsEmpty()
		{
			return (piece==null);
		}
		public bool Contains(pieces_chess.Kind type)
		{
			if (!IsEmpty())
			{
				return (piece.Type==type);
			}
			return false;
		}
    }
}
